﻿package Game
{
	import flash.display.Sprite;
	import Component.Avatar;
	import Component.Bomb;

	public class Player
	{
		private var _id:uint;
		public function get id():uint {
			return _id;
		}

		private var _name:String;
		public function get name():String {
			return _name;
		}
		
		private var _avatar:Avatar;
		public function get avatar():Avatar {
			return _avatar;
		}
		public function set avatar(avatar:Avatar):void {
			_avatar = avatar;
		}

		private var bombs:Vector.<Bomb>;

		public function Player(id:uint, name:String)
		{
			_id = id;
			this._name = name;
			this.bombs = new Vector.<Bomb>();
		}
		
		public function attach(bomb:Bomb) {
			bombs.push(bomb);
		}
		
		public function explode():Bomb {
			// take the older bomb
			return bombs.shift();
		}

	}

}